package com.itcs.box.server.resolver;

import com.alibaba.fastjson.JSON;
import com.itcs.box.domain.BoxResponse;
import io.netty.channel.ChannelHandlerContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 功能描述:
 * <发送盒子线程>
 *
 * @ClassName: Send2BoxThread
 * @Author: wanghui
 * @Date: 2019年05月17日 09:37:47
 *
 * @Copyright: 2019 Inc. All rights reserved. 注意: 本内容仅限于内部传阅,禁止外泄以及用于其他的商业目
 */
public class Send2BoxThread extends Thread {
	private static Log logger = LogFactory.getLog(Send2BoxThread.class);

	private SeBoxResolver seBoxResolver;

	private ChannelHandlerContext channel;

	private BoxResponse boxResponse;

	public Send2BoxThread(ChannelHandlerContext channel,
						  SeBoxResolver seBoxResolver, BoxResponse boxResponse) {
		this.channel = channel;
		this.seBoxResolver = seBoxResolver;
		this.boxResponse = boxResponse;
	}

	@Override
	public void run() {
		seBoxResolver.subBoxMsg(channel, JSON.toJSONString(boxResponse));
	}
}